In systems having a finite number of resources, the problem of resource allocation may be difficult to resolve. In the worst case scenario, the system may encounter a race condition or enter into a deadlocked state. Other undesirable outcomes may include dropped or delayed high priority requests and extreme inefficiency (e.g., low resource utilization, etc.).
A resource unit is any segment of a resource that can be allocated and freed by a single client (e.g., a thread). A resource unit may be a part of a group of resource units that is shared system wide. Allocation of a resource unit gives the client the right to use the resource unit. For example, a resource unit may be a page of physical memory, a page of swap space on disk, one unit of runtime on a central processing unit (CPU), a network packet, a block in the database buffer cache, etc. A resource allocation algorithm may be utilized to allocate and free resource units. The possible uses of resource allocation algorithms in hardware and software applications are many and varied.